<template>
  <div>
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="文章分类" name="first">
        <el-row>
          <classifyCard :classifys="calssify" ></classifyCard>
        </el-row>
      </el-tab-pane>
      <el-tab-pane label="标签" name="second">
        <el-row>
          <classifyCard :classifys="tag"></classifyCard>
        </el-row>
         </el-tab-pane>
    </el-tabs>

    <!-- <div class="art" v-for="item in 10" :key="item">
       
            <ArticleCard></ArticleCard>
        
      
    </div> -->
  </div>
</template>

<script>
import classifyCard from "./card/classifyCard.vue";
// import ArticleCard from "@/components/card/ArticleCard.vue";
import {getAllTag} from "@/api/tag"
import {getAllClassify} from '@/api/classify'

export default {
  created(){
    getAllClassify().then(res=>{
      this.calssify=res.data.map(v=>{
        return {...v,name:v.sortName}
      })

    })
    getAllTag().then(res=>{
      this.tag=res.data.map(v=>{
        return {...v,name:v.tagName}
      })

    })
  },
  data() {
    return {
      activeName: "first",
        calssify: [],
        tag: [],
    };
  },
  components: {
    classifyCard,
    // ArticleCard,
  },
  methods: {
  
    handleClick(tab, event) {
      // console.log(tab, event);
    },
  },
};
</script>

<style>
.art {
  /* width: 100%; */
  display: block;
  margin-top: 10px;

}
</style>